<template>
    <div >
        <t-tag shape="round" theme="primary" variant="light-outline">{{ $t(label) }}</t-tag>
    </div>
  
  </template>

  <script setup lang="tsx">
  import {onBeforeMount, ref} from 'vue';
  import { useDictStore } from "@/store";


  const dictStore = useDictStore();
  const label=ref('');
  /**
   * props 组件支持参数
   * @param dictType 字典类型
   * @param value 双向绑定的字段
   */
  const props = defineProps<{
		dictType: string,
    value: string | number,
	}>()

  /**
   * emit 事件
   */
  const emit = defineEmits(['update:value']);

  /**
   * 获取字典数据
   */
  const getSysDictType = async () => {
    label.value = await dictStore.toLabel(props.dictType,props.value);
  };


  onBeforeMount(async () => {
    await getSysDictType();
  });
  </script>
  <style lang="less" scoped>
 
  </style>
